<?php if (isset($this->question)):?>
<?php $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Poll/externals/scripts/core.js');?>
<?php if ($this->context != "smoothbox"): ?>
<div class="headline">
    <h2><?php echo $this->translate('Questions');?></h2>
    <div class="tabs">
      <?php
        // Render the menu
        echo $this->navigation()
          ->menu()
          ->setContainer(Engine_Api::_()->getApi('menus', 'core')
            ->getNavigation('poll_main', array ()))
          ->render();
      ?>  
    </div>
</div>
<style type="text/css">
.done_editing {position: static; float: right; right: auto;}
</style>
<div class="poll_title">
    <?php $owner = Engine_Api::_()->user()->getUser($this->question->user_id);?>
    <div class="owner_avatar"><?php echo $this->htmlLink($owner->getHref(), $this->UPhoto($owner, 'thumb.icon'));?></div>
    <div class="questions_question_content">
        <?php echo $this->translate('%s asked %s', $this->htmlLink($owner->getHref(), $owner->getTitle()), $this->htmlLink($this->question->getHref(), $this->question->getTitle()));?>
        <div class="poll_options_container">
        <div id="show_all_options" class="show_all_options">
            <?php echo $this->partial('_full_details_poll.tpl', 'poll', array('question' => $this->question, 'options' => $this->options));?>
        </div>
        </div>
    </div>
</div>
<?php else: ?>
<div id="show_all_options" class="show_all_options">
    <?php echo $this->partial('_full_details_poll.tpl', 'poll', array('question' => $this->question, 'options' => $this->options));?>
</div>    
<?php endif;?>
<script type="text/javascript">
window.addEvent('domready', function(){ 
    if (parent.document.id("TB_closeAjaxWindow")) {    
    parent.document.id('TB_closeAjaxWindow').setStyle('display', 'block');
    parent.document.id('TB_closeAjaxWindow').set('html', '<div class="tb_close" onclick="parent.document.id(\'TB_closeAjaxWindow\').setStyle(\'display\', \'none\');Smoothbox.close();"><i class="iClose"></i></div>');    
    }
});
</script>
<?php else: ?>
<div class="tip">
  <span>
    <?php echo $this->translate("Question does not exist! Click %s to go to questions page.", $this->htmlLink($this->url(array(), 'poll_general', true), $this->translate('here'))) ?>
  </span>
</div>
<?php endif; ?>